<!DOCTYPE html>
<html lang="en">
<head th:include="certificateWeb/headFoot :: headerCss">

</head>
<link rel="stylesheet" href="/css/certificateWeb/workNews/workNews.css">
<body id="body">
<div th:include="certificateWeb/headFoot :: header"></div>
<main id="main">
    <section class="sec_1">
        <div class="div_1">
            <ul>
                <li><a href="/certificate/my">个人信息</a></li>
                <li><a href="/certificate/isResume">我的简历</a></li>
                <!-- <li><a href="/certificate/findApplyExam">报名记录</a></li> -->
                <li><a href="/certificate/infoRecordList">表单提交记录</a></li>
                <li><a href="/certificate/expertRecordList">专家申请记录</a></li>
                <li><a href="/certificate/stationRecordList">考核站点申请记录</a></li>
                <li><a href="/certificate/stationPxRecordList">培训基地申请记录</a></li>
                <li class="this"><a href="/certificate/gradeQuery">成绩查询</a></li>
                <li><a href="/certificate/message">消息中心</a></li>
                <li><a href="/certificate/childExam">幼儿照护模拟考试</a></li>
                <li><a href="/certificate/recoverExam">产后恢复模拟考试</a></li>
                <!-- <li onclick="mock2(this)" data-type="2"><a>幼儿照护初级模拟考试</a></li>
               <li onclick="mock2(this)" data-type="1"><a>幼儿照护中级模拟考试</a></li>
               <li onclick="mock2(this)" data-type="0"><a>幼儿照护高级模拟考试</a></li> -->
            </ul>
        </div>
        <div class="div_2">
            <label class="label_title">成绩查询</label>
            <hr/>

            <div class="msgBox">
                <select name="type" id="year" class="form-control" style="margin-bottom:5px;">
                    <option value="">请选择考试年份</option>
                    <option value="2020">2020</option>
                    <option value="2021">2021</option>
                    <option value="2022">2022</option>
                    <option value="2023">2023</option>
                </select>
                <input type="text" name="numbers" 　id="name" placeholder="姓名 " class="form-control" style="margin-bottom:5px;"/>
                <input type="text" name="mobile" 　id="ticketNumber" placeholder="准考证号" class="form-control"  style="margin-bottom:5px;"/>
                <input type="text" name="mobile" 　id="idNumber" placeholder="考生编号" class="form-control" style="margin-bottom:5px;" />
                <p class="form-control" style="color:red;border: none">注：专家培训考试成绩查询，准考证号为身份证号，考生编号为手机号</p>
                <input class="form-control but_2" type="button" id="search" value="查询" style="margin:0px auto;"/>
            </div>
            <div class="div_2 div_01" id="list" style="margin-top: 20px">
            </div>
            <div id="news"></div>
            <div id="page"></div>
        </div>
        <div style="clear: both"></div>
    </section>
</main>
<div th:include="certificateWeb/headFoot :: footer"></div>
</body>
<script type="text/javascript" src="/js/mobile.js"></script>
<script>
    $(function () {
        $("#search").click(function () {
            var year = $("#year").val();
            var name = $("#name").val();
            var ticketNumber = $("#ticketNumber").val();
            var idNumber = $("#idNumber").val();
            // var mobile = $("#mobile").val();
            if (year==null||year==""||name==""||name==null||ticketNumber==null||ticketNumber==""||idNumber==""||idNumber==null){
                layer.msg("查询信息填写不完整！");
                return false;
            }
            $.ajax({
                url: '/certificate/selExaminationResult',
                type:'POST',
                data: {
                    current: 1,
                    number: 5,
                    year:year,
                    name: name,
                    ticketNumber: ticketNumber,
                    idNumber: idNumber
                },
                success: function (res) {

                    if (res.code == 0) {
                        var list = res.data;
                        var news = '';
                        if(list.length<=0){
                            layer.msg("未查询到成绩！")
                            return false
                        }
                        list.forEach(function (item, index) {
                            var a = item.practicalScore+'分';
                            if (item.practicalScore == null || item.practicalScore == '') {
                                a = '无'
                            }
                            news +=
                                '<div class="my_bg div_01"><div class="span_1" style="flex: 6"><span class="title_1">批次名称：</span><p class="title_2">' + item.ebatchName + '</p></div>' +
                                '<div style="display: flex;justify-content: space-between">' +
                                '<div class="span_1" style="flex: 6"><span class="title_1">理论考试成绩：</span><p class="title_2">' + item.totalScore + '分</p></div>' +
                                '</div>' +
                                '<div style="display: flex;justify-content: space-between">' +
                                '<div class="span_1" style="flex: 6"><span class="title_1">实操考试成绩：</span><p class="title_2">' + a + '</p></div>' +
                                '</div></div>'
                        });
                        $("#news").html(news);
                    }else{
                        layer.msg(res.msg)
                    }

                }
            })

        })

    })
    // $(function () {
    //
    //     ajaxToken("/jzApi/user/selAchievementList", "GET", {
    //         type: 1,
    //         state: '',
    //         current: 1,
    //         number: 14
    //     }, function (res) {
    //
    //         if (res.pages == 0) {
    //             $("#news").html('<div class="noData">暂无数据</div>');
    //         } else {
    //             var list = res.records;
    //             var news = '';
    //             list.forEach(function (item, index) {
    //                 var a = '';
    //                 if (item.type == 0) {
    //                     a = '理论考试'
    //                 }
    //                 if (item.type == 1) {
    //                     a = '技能考试'
    //                 }
    //                 if (item.type == 2) {
    //                     a = '社会实践'
    //                 }
    //                 news +=
    //                     '<div class="my_bg div_01"><div class="span_1" style="flex: 6"><span class="title_1">批次名称：</span><p class="title_2">' + item.cbatchName + '</p></div>' +
    //                     '<div style="display: flex;justify-content: space-between">' +
    //                     '<div class="span_1" style="flex: 6"><span class="title_1">考试名称：</span><p class="title_2">' + item.name + '</p></div>' +
    //                     '<div class="span_1" style="flex: 2"><span class="title_1">考试类型：</span><p class="title_2">' + a + '</p></div>' +
    //                     '</div>' +
    //                     '<div style="display: flex;justify-content: space-between">' +
    //                     '<div class="span_1" style="flex: 6"><span class="title_1">考试总分数：</span><p class="title_2">' + item.totalScore + '分</p></div>' +
    //                     '<div class="span_1" style="flex: 2"><span class="title_1">考试时间：</span><p class="title_2">' + item.startTime + '</p></div>' +
    //                     '</div></div>'
    //             });
    //             $("#news").html(news);
    //             page(1, res.pages);
    //         }
    //
    //     });
    // });

    function page(num, tolPages) {
        $("#page").paging({
            nowPage: Number(num), // 当前页码
            pageNum: Number(tolPages), // 总页码
            buttonNum: 3, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                ajaxToken("/jzApi/user/selAchievementList", "GET", {
                    type: 1,
                    state: '',
                    current: num,
                    number: 14,
                    t: new Date()
                }, function (res) {
                    console.log(res);
                    var list = res.records;
                    var news = '';
                    list.forEach(function (item, index) {
                        var a = '';
                        if (item.type == 0) {
                            a = '理论考试'
                        }
                        if (item.type == 1) {
                            a = '技能考试'
                        }
                        if (item.type == 2) {
                            a = '社会实践'
                        }
                        news +=
                            '<div class="my_bg div_01"><div class="span_1" style="flex: 6"><span class="title_1">批次名称：</span><p class="title_2">' + item.cbatchName + '</p></div>' +
                            '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 6"><span class="title_1">考试名称：</span><p class="title_2">' + item.name + '</p></div>' +
                            '<div class="span_1" style="flex: 2"><span class="title_1">考试类型：</span><p class="title_2">' + a + '</p></div>' +
                            '</div>' +
                            '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 6"><span class="title_1">考试总分数：</span><p class="title_2">' + item.totalScore + '分</p></div>' +
                            '<div class="span_1" style="flex: 2"><span class="title_1">考试时间：</span><p class="title_2">' + item.startTime + '</p></div>' +
                            '</div></div>'
                    });
                    $("#news").html(news)

                });
            }
        });
    }

</script>
<script type="text/javascript" src="/js/xlPaging.js"></script>
</html>